<?php
require_once 'global.php';

$view = 'items/comments.html';

if ($_SERVER['PATH_INFO']) {
    $data = explode("/", $_SERVER['PATH_INFO']);
    $_REQUEST['iid']    = $data[1];
    $_REQUEST['act']    = $data[2];

    if ($_REQUEST['act']=='new') {
        $view = 'items/newcomment.html';
    } else if ($_REQUEST['act']=='xml') {
        $view = ($_REQUEST['iid'] == 'all' ? 'xml/commentsall.xml' : 'xml/comments.xml');
    } else if ($_REQUEST['iid']=='all') {
        $view = 'items/commentsall.html';
    } else {
        $view = 'items/comments.html';
    }
}

$Controller =& getController('comments');
$View = $Controller->getView('comments');
$View->display($view);
?>
